#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
	ll k;
	cin >> k;
	string s,s1="ChuiZi",s2="Jiandao",s3="Bu";
	ll cnt=1;
	while(cin>> s)
	{
		if(s=="End") return 0;
		
		if(cnt%(k+1)==0)
		{
			cout<<s<<endl;
		}
		else{
			if(s=="ChuiZi")
			{
				cout<<"Bu"<<endl;
			}
			else if(s=="JianDao")
			{
				cout<<"ChuiZi"<<endl;
			}
			else if(s=="Bu"){
				cout<<"JianDao"<<endl;
			}
		}
		cnt++;
	}
}
